package websocket;

import java.io.UnsupportedEncodingException;
import java.util.Base64;

public class TestHmacSha1 {
    public static void main(String[] args) throws Exception {

        byte[] res = Sha1Util.HmacSHA1Encrypt("shrek","thisisadevtesttoken");

        byte[] bytes;
        try {

            System.out.println(String.valueOf(new String(res).getBytes("utf-8")));
            bytes = Base64.getEncoder().encode(res);

            System.out.println(new String(bytes, "utf-8"));
            System.out.println("pj5uzMxuRjpC0F606qWVhwV5baI=");
        } catch (UnsupportedEncodingException e) {
            System.out.println("error");
        }

    }
}
